package com.snpic.appaw.module.third.config.aliyun;

import com.aliyun.teaopenapi.models.Config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author JiJun
 * @date 2025/9/21 16:32
 * @修改时间 2025/9/21 16:32
 * @description 阿里云，号码认证，相关配置
 */
@Data
@Component
@ConfigurationProperties(prefix = "third-party.aliyun.phone-number-authentication")
public class PhoneNumberAuthenticationConfig {
	//请求页面地址。请传入在控制台创建认证方案时填入的页面地址，格式为“协议 + // + 域名 + /”。
	private String url;

	//请求源地址。请传入在控制台创建认证方案时填入的源地址，格式为“协议 + // + 域名”。
	private String origin;

	private String accessKeyId;

	private String accessKeySecret;

	@Bean
	public  com.aliyun.dypnsapi20170525.Client createClient() throws Exception {
		Config config = new Config();
		config.accessKeyId = accessKeyId;
		config.accessKeySecret = accessKeySecret;
		return new com.aliyun.dypnsapi20170525.Client(config);
	}

}
